package cn.edu.swufe.surverpark.scheduler;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

import cn.edu.swufe.surverpark.struts2.service.LogService;
import cn.edu.swufe.surverpark.util.LogUtil;

/**
 * @author 陈龙 E-mail:529914446@qq.com
 * @version创建时间:2015年5月7日上午6:42:14 类说明
 */
public class CreateLogTablesTask extends QuartzJobBean{
	
	private LogService logService;
	
	public void setLogService(LogService logService) {
		this.logService = logService;
	}
	@Override
	protected void executeInternal(JobExecutionContext arg0)
			throws JobExecutionException {
		String tableName = LogUtil.generateLogTableName(1);
		logService.createLogTable(tableName);
		
		tableName = LogUtil.generateLogTableName(2);
		logService.createLogTable(tableName);

		tableName = LogUtil.generateLogTableName(3);
		logService.createLogTable(tableName);
		
	}
}
